#include <stdio.h>
#include "include/stack.h"

int a[] = { 56, 34, 54, 47, 78, 91, 24, 87, 74, 69, 43, 63, 58, 38, 25, 49, 23, 12, 8, 76, 85, 102, 99, 29 };

void test_stack()
{
    int num = sizeof(a)/sizeof(int);
    stack_t head = NULL;
    for(int i=0; i<num; i++)
    {
        stack_push(&head, a[i]);
    }
    stack_print(head);

    stack_node_t *t = NULL;
    for(int i=0; i<num; i++)
    {
        t = stack_pop(&head);
        printf("%d, ", t->data);
    }

    printf("%p\n", head);
}

int main()
{
    test_stack();
}